﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Okuma.CLDATAPI.DataAPI;
using Okuma.CLDATAPI.Enumerations;

namespace Okuma
{
    public static class THINCProvider
    {
        private static SubSystemEnum[] m_validSubsystems;

        public static string MachineName { get; private set; }
        public static string MachineSerialNumber { get; private set; }

        static THINCProvider()
        {
            CSpec spec = new CSpec();

            GetValidSubsystems(spec);
            MachineName = spec.GetMachineName();
            MachineSerialNumber = spec.GetMachineSerialNumber();
        }

        private static void GetValidSubsystems(CSpec spec)
        {
            var list = new List<SubSystemEnum>();


            foreach(var val in Enum.GetValues(typeof(SubSystemEnum)))
            {
                if(spec.IsValidSystem((SubSystemEnum)val))
                {
                    list.Add((SubSystemEnum)val);
                }
            }

            m_validSubsystems = list.ToArray();
        }

        public static SubSystemEnum[] ValidSubsystems
        {
            get { return m_validSubsystems; }
        }
    }
}
